package com.wh.wisdomsite.xbox.me.service.impl;

import com.baomidou.mybatisplus.mapper.SqlHelper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.wh.wisdomsite.xbox.me.dao.CraneProjectMapper;
import com.wh.wisdomsite.xbox.me.entity.CraneProject;
import com.wh.wisdomsite.xbox.me.service.ICraneProjectService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 起重器械项目设备craneProjectService业务层实现类
 * @package com.wh.wisdomsite.xbox.me.service.impl
 * @author 蔡道行
 * @version V1.0
 * @date 14:00 2018/8/5
 * @Copyright 公司版权所有
 * @Company 贵州万华科技有限公司Copyright (c) 2014
 */

@Service("craneProjectService")
@Transactional(rollbackFor = {Exception.class,RuntimeException.class})
public class CraneProjectServiceImpl extends ServiceImpl<CraneProjectMapper,CraneProject> implements ICraneProjectService {

    private static final Log logger = LogFactory.getLog(CraneProjectServiceImpl.class);

    @Autowired
    private CraneProjectMapper craneProjectMapper;

    @Override
    public Map<String, Object> getMapById(String cpId) {
        return craneProjectMapper.getMapById(cpId);
    }

    @Override
    public Page<Map<String, Object>> getMapsPage(Page page, Wrapper<CraneProject> wrapper) {
        SqlHelper.fillWrapper(page,wrapper);
        page.setRecords(this.baseMapper.getMapsPage(page,wrapper));
        return page;
    }

    @Override
    public List<CraneProject> selectList(Wrapper<CraneProject> wrapper) {
        return craneProjectMapper.selectList(wrapper);
    }

    @Override
    public Map<String, Object> getTotal(Wrapper<CraneProject> var1) {
        return craneProjectMapper.getTotal(var1);
    }
}
